package com.cskaoyan.market.util;

import java.io.UnsupportedEncodingException;

/**
 * @Author 远志 zhangsong@cskaoyan.onaliyun.com
 * @Date 2024/5/21 10:54
 * @Version 1.0
 */
public class DigestUtils {

    public static String md5(String content, String salt) throws UnsupportedEncodingException {
        content = content + salt;
        return org.springframework.util.DigestUtils.md5DigestAsHex(content.getBytes("utf-8"));
    }

    public static String twiceMd5(String content, String salt) throws UnsupportedEncodingException {
        return md5(md5(content, salt), salt);
    }
}
